package com.huangbc.serviceDriverUser.controller;


import com.huangbc.internalcommon.dto.Car;
import com.huangbc.internalcommon.dto.ResponseResult;
import com.huangbc.serviceDriverUser.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Derek.huangbc
 * @since 2024-03-29
 */
@RestController
public class CarController {

    @Autowired
    CarService carService;

    @PostMapping("/car")
    public ResponseResult addCar(@RequestBody Car car){

        return carService.addCar(car);
    }

    @GetMapping("/getCar")
    public ResponseResult<Car> getCarById(Long carId){

        return carService.getCarById(carId);
    }
}

